package org.example.redis.service.impl;

import org.example.redis.entity.ApiAccountEntity;
import org.example.redis.repository.ApiAccountRepository;
import org.example.redis.service.ApiAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApiAccountServiceImpl implements ApiAccountService {
    @Autowired
    private ApiAccountRepository apiAccountRepository;
    // 注册
    @Override
    public int addApiAccount(ApiAccountEntity apiAccount) {
        return apiAccountRepository.save(apiAccount).getId();
    }
    // 查询
    @Override
    public ApiAccountEntity findByAccount(String account) {
        return apiAccountRepository.findByAccount( account);
    }
}
